关于asp提交内容中有<select>的情况

来源:百度知道 编辑:UC知道 时间:2024/06/22 07:34:25
<form method=post name=form1 action=j.asp action=search>
<input style="WIDTH: 300px; COLOR: #9f9f9f" id=hw_name name=hw_name>
<select id=type name=type>
<option selected value=1>产品</option>
<option value=2>客服</option>
<option value=3>订单</option>
<option value=4>维修</option>
</select>
<input style="HEIGHT: 25px" value=" 搜 索 " type=submit name=Submit2>
</form>
在j.asp 中
如何返回是那个<option>

<%@ language=javascript %>
<%
这样的写法

var a = Request.Form["type"];
var strselect=Request.Form["hw_name"];
Response.Write("<li>" + a);
Response.Write("<li>" + strselect);
显示的内容是:

undefined
undefined

var a = Request.Form("type")
var strselect=Request.Form("hw_name")
替换原来的 就OK了!

<%@ language=javascript %>
<%
var a = Request.Form["type"];

// a = 1

不管是javascript还是vbscript写的都是一样的
用request.form("type")这样就可以了

var a = Request.Form["type"];将[]改为()

莫名其妙,你的问题是什么?